package com.dailyblue.java.spring.aop;

import com.dailyblue.java.spring.aop.target.FirstTarget;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App {
    public static void a(){
        ApplicationContext beans = new ClassPathXmlApplicationContext("applicationContext.xml");
        FirstTarget target = beans.getBean("proxy", FirstTarget.class);
        target.save("1","aa");
    }

    public static void b(){
        ApplicationContext beans = new AnnotationConfigApplicationContext("com.dailyblue.java.spring.aop");
        FirstTarget firstTarget = beans.getBean(FirstTarget.class);
        firstTarget.findName(1);
        //firstTarget.save("a","aa");
    }
    public static void main(String[] args) {
        b();
    }
}
